package sky.wicket;

import org.apache.wicket.model.Model;
import sky.treasure.Area;
import sky.treasure.AreaView;
import sky.treasure.Coordinates;
import sky.treasure.properties.AreaPropertyHolder;
import sky.treasure.properties.ObstacleProperty;
import sky.treasure.properties.TrapProperty;
import sky.treasure.properties.TreasureProperty;
import sky.wicket.panels.AreaPanel;

import java.util.HashSet;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 05.01.14
 * Time: 23:19
 * To change this template use File | Settings | File Templates.
 */
public class Game extends BasePage {

    public Game() {
        AreaPropertyHolder propertyHolder = new AreaPropertyHolder();
        TrapProperty traps = new TrapProperty();
        traps.addCoordinates(new Coordinates(0, 2)).addCoordinates(new Coordinates(1, 1));
        TreasureProperty treasure = new TreasureProperty();
        treasure.addCoordinates(new Coordinates(1, 2));
        ObstacleProperty obstacles = new ObstacleProperty();
        obstacles.addCoordinates(new Coordinates(3, 3)).addCoordinates(new Coordinates(4, 1));
        propertyHolder.addProperty(traps);
        propertyHolder.addProperty(treasure);
        propertyHolder.addProperty(obstacles);
        AreaView areaView = new AreaView(new Coordinates(5, 5), propertyHolder);
        AreaPanel panel = new AreaPanel("panel", new Model<AreaView>(areaView));
        add(panel);
    }
}
